<route lang="json5" type="page">
{
  style: {
    navigationStyle: 'custom',
    navigationBarTitleText: '',
  },
}
</route>

<template>
  <div class="user">
    <NavBar placeholder>
      <template #left>
        <span></span>
      </template>
    </NavBar>
    <!-- 用户信息 -->
    <UserInfo />

    <!-- 账号收入信息 -->
    <!-- && userStore.userInfo.userType === 1 -->
    <Income v-if="userStore.isLogged" />

    <!-- 我的订单 -->
    <MyOrder />

    <!-- 我的服务 -->
    <Sverice />
  </div>

  <TabBar :scrollTop="scrollTop" />
</template>

<script lang="ts" setup>
import UserInfo from './components/UserInfo.vue'
import Income from './components/Income.vue'
import MyOrder from './components/MyOrder.vue'
import Sverice from './components/Sverice.vue'
import { useUserStore } from '@/store/index'

const scrollTop = ref(0)
onPageScroll((e) => {
  scrollTop.value = e.scrollTop
})
onHide(() => {
  uni.pageScrollTo({
    scrollTop: 0,
    duration: 0,
  })
})

const userStore = useUserStore()
</script>

<style lang="scss" scoped>
.user {
  box-sizing: border-box;
  min-height: 100vh;
  padding-bottom: 180px;
  padding-bottom: calc(constant(safe-area-inset-bottom) + 180rpx) !important;
  padding-bottom: calc(env(safe-area-inset-bottom) + 180rpx) !important;
  background-color: var(--bgc4);
}
</style>
